package com.example.service;

import com.hazelcast.cluster.Member;
import com.hazelcast.cluster.MembershipListener;
import com.hazelcast.collection.IQueue;
import com.hazelcast.collection.ISet;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.core.IExecutorService;
import com.hazelcast.core.LifecycleListener;
import com.hazelcast.cp.CPSubsystem;
import com.hazelcast.cp.IAtomicLong;
import com.hazelcast.cp.IAtomicReference;
import com.hazelcast.cp.ICountDownLatch;
import com.hazelcast.cp.lock.FencedLock;
import com.hazelcast.crdt.pncounter.PNCounter;
import com.hazelcast.durableexecutor.DurableExecutorService;
import com.hazelcast.map.IMap;
import com.hazelcast.multimap.MultiMap;
import com.hazelcast.replicatedmap.ReplicatedMap;
import com.hazelcast.scheduledexecutor.IScheduledExecutorService;
import com.hazelcast.topic.ITopic;
import com.hazelcast.transaction.TransactionContext;
import com.hazelcast.transaction.TransactionOptions;

import java.util.Set;

public interface HazelcastService {

    public HazelcastInstance getHazelcastInstance();

    public Set<Member> getMember();

    public void addMembershipListener(MembershipListener membershipListener);

    public void addLifecycleListener(LifecycleListener lifecycleListener);

    public long getFlakeId(String name);

    public CPSubsystem getCPSubsystem();

    public ITopic getTopic(String name);

    public IQueue getQueue(String name);

    public IMap getMap(String name);

    public MultiMap getMultiMap(String name);

    public ReplicatedMap getReplicatedMap(String name);

    public ISet getSet(String name);

    public PNCounter getPNCounter(String name);

    public IAtomicLong getIAtomicLong(String name);

    public IAtomicReference getIAtomicReference(String name);

    public FencedLock getLock(String name);

    public DurableExecutorService getDurableExecutorService(String name);

    public IExecutorService getExecutorService(String name);

    public IScheduledExecutorService getScheduledExecutorService(String name);

    public ICountDownLatch getCountDownLatch(String name);

    public TransactionContext getTransactionContext(TransactionOptions.TransactionType type);
}